The disclosure herein generally relates to enhancing software application performance within a given operating system environment.
Interrupt-driven processors frequently execute code at different privilege levels, the different privilege levels conveying different permissions to perform operations. For example, the executable code of an operating system, such as the code for the operating system kernel, is typically run at a higher privilege level than the code of ordinary application programs. In this environment, application code or other code running at a lower privilege level may lack sufficient permissions to perform certain operations, such as writing to particular areas of memory (e.g., writing to memory of the network protocol stack for sending a packet). As a consequence, the application code must communicate a request to the code of a high privilege level, such as the operating system kernel code, to perform the operation on its behalf. In order to maintain security, the request must typically be made through some form of gate mechanism—such as an interrupt, or a system call resulting in a software interrupt—that checks the operation to ensure that it does not violate security constraints.
However, the use of software interrupts generated by system calls and other gate mechanisms imposes additional overhead and can lead to significant degradation of performance, and even to lost data. In response to a software interrupt from an application, the operating system must save the state of the application, execute appropriate code to handle the interrupt, and then restore the application state, disabling further interrupt processing while this is taking place. This process can be time-consuming relative to other processing operations and in the aggregate can consume a significant share of the system's processing in a system experiencing frequent interrupts, such as when performing a significant number of I/O operations such as reading from a solid state disk or sending data over a network. Further, since interrupt processing is disabled, if other interrupts occur during interrupt processing the interrupts will not be handled and thus any information associated with the interrupt will be lost.